import Vue from 'vue'
import VueRouter from 'vue-router'
// 公共页面
import Home from '../views/Home/Home.vue'
import main from '../views/Layout/main.vue'
// import Login from '../../../PublicPage/Login/Login.vue'
// import identification from '../../../PublicPage/Login/index.vue'
// import register from '../../../PublicPage/Register/register.vue'
// import forgetPassword from '../../../PublicPage/ForgetPassword/forgetPassword.vue'

// 用户端
import findHomemaking from '../views/FindHomemaking/findHomemaking.vue'
import Orders from '../views/Orders/orders.vue'
import chat from '../views/Chat/chat.vue'
import demand from '../views/Demand/demand.vue'
import wallet from '../views/Wallet/wallet.vue'
import address from '../views/Address/address.vue'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
export const routes = [
    // {
    //     path: '/Login',
    //     name: 'Login',
    //     component: Login,
    //     hidden: true
    // },
    // {
    //     path: '/identification',
    //     name: 'identification',
    //     component: identification,
    //     hidden: true
    // },
    // {
    //     path: '/register',
    //     name: 'register',
    //     component: register,
    //     hidden: true
    // },
    // {
    //     path: '/forgetPassword',
    //     name: 'forgetPassword',
    //     component: forgetPassword,
    //     hidden: true
    // },
    {
        path: '/',
        name: "findHomemaking",
        label: "找家政",
        icon: "s-home",
        component: findHomemaking,
    },

    // 用户端
    {
        path: '/home',
        name: 'Main',
        component: main,
        children: [{
                path: '/Home',
                name: "Home",
                label: "首页",
                icon: "s-home",
                component: Home,
            },
            {
                path: '/Orders',
                name: "Orders",
                label: "订单",
                icon: "s-order",
                component: Orders,
            },
            {
                path: '/wallet',
                name: "wallet",
                label: "账单",
                icon: "notebook-2",
                component: wallet,
            },
            {
                path: '/Chat',
                name: "chat",
                label: "聊天室",
                icon: "s-comment",
                component: chat,
            },
            {
                path: '/demand',
                name: "demand",
                label: "需求",
                icon: "tickets",
                component: demand,
            },
            {
                path: '/address',
                name: "address",
                label: "地址簿",
                icon: "s-promotion",
                component: address,
            },
        ]
    },
]

export const asyncRoutes = [

]

const router = new VueRouter({
    routes
})

export default router